import requests
# 封装三部走：1、不变的直接写入，变化的直接设置为参数，返回的结果使用return返回。

class Login():
    def ihrm_login(self, req_json):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/login",
                             json=req_json)
        #
        # url = "http://ihrm2-test.itheima.net/api/sys/login",
        # json = {"mobile": "13800000002", "password": "123456"}
        print(resp.json())
        return resp


if __name__ == '__main__':
    ret = Login()
    resp = ret.ihrm_login({"mobile": "13800000002", "password": "123456"})
    print(resp)
